<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .moreTitle {
            position: absolute;
            top: 200px;
            width: 200px;
            height: 100px;
            background-color: skyblue;
        }
        .moreTitle::after {
            position: absolute;
            content: '';
            top: -25px;
            width: 50px;
            height: 50px;
            background-color: green;
        }
        .moreTitle::before {
            position: absolute;
            content: '';
            top: 0;
            width: 200px;
            height: 50px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div class="moreTitle">

    </div>

    <script>
        let div = document.createElement('div');
        document.body.appendChild(div);

        document.addEventListener('mousemove',function (e) {

            div.className = 'moreTitle';

            let x = e.pageX  + 10;
            let y = e.pageY + 10;
            div.style.left = x +  'px';
            div.style.top = y + 'px';

        })

    </script>
</body>
</html>